import React from "react"
import { SearchBar, Button, WhiteSpace, WingBlank,TabBar } from 'antd-mobile';
import { Carousel } from 'antd-mobile';
import { Flex } from 'antd-mobile';
import { Tabs, Badge } from 'antd-mobile';
import {getBanner,getGedan, login, getNewCD,searchHot,searchSong} from "../../api/index"

//路由
// import Tuijian from "./tuijian"
// import Gedan from "./gedan"
// import Paihangbang from "./paihangbang"
// import Diantai from "./diantai"
// import Zhibo from "./zhibo"

// import {Route} from "react-router-dom"

import disIndex from "./css/index.module.css"


  


class Discover extends React.Component{
    constructor(){
        super()
        this.state = {
                banners: [],
                imgHeight: 176,
                newCd:[],
                newCdUrl:[],
                newCdName:[],
                tjGedan:[],
                search:true,
                hotSearch:[]
        }
    }
    componentDidMount() {
        // login()
        // .then(body=>body.json())
        // .then(res=>{
        //     // console.log(res)
        // })
    // 获取轮播图
        getBanner()
        .then(body=>body.json())
        .then(res=>{
            this.setState({
                banners:res.banners
            })
            // console.log(this.state.banners)
        })
    // 获取每日推荐歌单
        getGedan()
        .then(body=>body.json())
        .then(res=>{
            this.setState({
                tjGedan:res.result
            })
            // console.log(this.state.tjGedan)
        })

        // 新碟
        getNewCD()
        .then(body=>body.json())
        .then(res=>{
            this.setState({
                newCd:res.albums
            })
            // console.log(this.state.newCd)
        })
        //搜索默认词
        searchHot()
        .then(body=>body.json())
        .then(res=>{
            this.setState({
                hotSearch:res.result.hots
            })
            console.log(this.state.hotSearch)
            // console.log(res)
        })
    }
    searchSongs(value){
        searchSong(value)
        .then(body=>body.json())
        .then(res=>{
            console.log(res)
        })
    }
    jumpToGd(gdId){
        this.props.history.push("/gdDetail?id="+gdId)
    }
    sendToTuijian(){
        this.props.history.push("/tuijian")
    }
    sendToGedan(){
        this.props.history.push("/gedan")

    }
    sendToPaihangbang(){
        this.props.history.push("/paihangbang")
    }
    sendToDiantai(){
        this.props.history.push("/diantai")
    }
    sendToZhibo(){
        this.props.history.push("/zhibo")
    }
    handleSearchT(){
        this.setState({
            search:false
        })
        console.log(this.state.search)
    }
    handleSearchF(){
        this.setState({
            search:true
        })
        console.log(this.state.search)
    }
    render(){
        try {
            this.state.newCdUrl.push(this.state.newCd[0].blurPicUrl)
            this.state.newCdUrl.push(this.state.newCd[1].blurPicUrl)
            this.state.newCdUrl.push(this.state.newCd[2].blurPicUrl)
            this.state.newCdName.push(this.state.newCd[0].name)
            this.state.newCdName.push(this.state.newCd[1].name)
            this.state.newCdName.push(this.state.newCd[2].name)
            // console.log(this.state.newCdUrl)
        } catch (error) {
            
        }
        // this.state.url = this.state.newCd[0].blurPicUrl
        if(this.state.search){
            return(
                <div className={disIndex.discover}>
                    <div className={disIndex.header}>
                        <div className={disIndex.shiqu}>
                        <svg t="1573803580998" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6229" width="32" height="46"><path d="M479.713154 703.614086c123.607202 0 223.857441-100.18577 223.857441-223.857441V223.921909c0-123.671671-100.250238-223.857441-223.857441-223.857441-123.608226 0-223.857441 100.18577-223.85744 223.857441v255.835759c0 123.670647 100.249215 223.856417 223.85744 223.856418zM319.815421 223.921909c0-88.319511 71.579245-159.897733 159.897733-159.897733s159.89671 71.578222 159.896711 159.897733v255.835759c0 88.321558-71.577199 159.89978-159.896711 159.89978s-159.897733-71.578222-159.897733-159.89978V223.921909z" p-id="6230"></path><path d="M799.509644 383.817596c-17.662265 0-31.980365 14.3181-31.980365 31.980365v63.958684c0 158.962431-128.856763 287.818171-287.816125 287.818171-158.960385 0-287.816125-128.85574-287.816124-287.818171v-63.918775l0.001023-0.039909c0-17.662265-14.3181-31.980365-31.980365-31.980365s-31.980365 14.3181-31.980366 31.980365v63.958684c0 183.473685 140.478452 334.153476 319.795467 350.314551v129.379672H351.795786c-17.662265 0-31.980365 14.3181-31.980365 31.980366s14.3181 31.980365 31.980365 31.980365h255.833713c17.662265 0 31.980365-14.3181 31.980366-31.980365s-14.3181-31.980365-31.980366-31.980366h-95.937003V830.071196c179.317015-16.161075 319.797513-166.840866 319.797514-350.314551v-63.958684c0-17.661242-14.3181-31.980365-31.980366-31.980365z" p-id="6231"></path></svg>
                        </div>
                        <div  className={disIndex.search}>
                            <SearchBar  onFocus={this.handleSearchT.bind(this)} placeholder="Search" maxLength={8} />
                            <WhiteSpace />
                        </div>
                        <div className={disIndex.bofang}>
                        <svg t="1573806248923" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7780" width="40" height="40"><path d="M896 960c-23.6 0-42.7-19.1-42.7-42.7v-512c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v512c0 23.6-19.1 42.7-42.7 42.7z m-256 0c-23.6 0-42.7-19.1-42.7-42.7V490.7c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v426.7c0 23.5-19.1 42.6-42.7 42.6z m-256 0c-23.6 0-42.7-19.1-42.7-42.7V106.7c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v810.7c0 23.5-19.1 42.6-42.7 42.6z m-256 0c-23.6 0-42.7-19.1-42.7-42.7V618.7c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v298.7c0 23.5-19.1 42.6-42.7 42.6z" fill="#333333" p-id="7781"></path></svg>
                        </div>
                    </div>
                    <div className={disIndex.banner}>
                    <WingBlank>
                        <Carousel
                        autoplay
                        infinite
                        // beforeChange={(from, to) => console.log(`slide from ${from} to ${to}`)}
                        // afterChange={index => console.log('slide to', index)}
                        >
                        {this.state.banners.map((item,index) => (
                            <a
                            key={index}
                            // href="http://www.alipay.com"
                            style={{ display: 'inline-block', width: '100%', height: this.state.imgHeight }}
                            >
                            <img
                                src={item.imageUrl}
                                alt=""
                                className={disIndex.bannerPic}
                                style={{ width: '100%', verticalAlign: 'top' }}
                                onLoad={() => {
                                // fire window resize event to change height
                                window.dispatchEvent(new Event('resize'));
                                this.setState({ imgHeight: 'auto' });
                                }}
                            />
                            </a>
                        ))}
                        </Carousel>
                    </WingBlank>
                    </div>
                    <div className={disIndex.nav}>
                        <div onClick={this.sendToTuijian.bind(this)}>
                            <svg t="1573828970138" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9885" width="40" height="40"><path d="M927.999 1024H96c-26.51 0-48.005-21.476-48.005-48.006V143.997c0-26.51 21.496-48.006 48.005-48.006h80.01v48.006c0 53.019 42.972 95.991 95.99 95.991s95.992-42.992 95.992-95.991V96.01H416v48.006c0 53.019 42.972 95.991 95.991 95.991s95.991-42.992 95.991-95.991V96.01h48.006v48.006c0 53.019 42.972 95.991 95.991 95.991s95.991-42.992 95.991-95.991V96.01h80.01c26.51 0 48.005 21.497 48.005 48.006v831.997c0.02 26.51-21.476 47.986-47.985 47.986zM800.004 368.003H223.996c-26.51 0-48.005 21.496-48.005 48.006s21.496 48.005 48.005 48.005h576.008c26.51 0 48.005-21.496 48.005-48.005s-21.496-48.006-48.005-48.006z m0 208.005H223.996c-26.51 0-48.005 21.496-48.005 48.005s21.496 48.006 48.005 48.006h576.008c26.51 0 48.005-21.496 48.005-48.006s-21.496-48.005-48.005-48.005z m8 208.004H215.996c-22.098 0-40.004 17.907-40.004 40.005 0 22.097 17.906 40.004 40.004 40.004h592.01c22.098 0 40.004-17.907 40.004-40.004-0.02-22.098-17.927-40.005-40.004-40.005z m-56.006-592.01c-26.51 0-48.006-21.496-48.006-48.005V48.006C703.992 21.496 725.49 0 751.998 0c26.51 0 48.006 21.496 48.006 48.006v96.01c0 26.49-21.497 47.987-48.006 47.987z m-240.008 0c-26.51 0-48.006-21.496-48.006-48.005V48.006C464.004 21.496 485.481 0 511.99 0c26.51 0 48.006 21.496 48.006 48.006v96.01c0 26.49-21.497 47.987-48.006 47.987z m-239.988 0c-26.51 0-48.006-21.496-48.006-48.005V48.006C223.996 21.496 245.493 0 272.002 0s48.006 21.496 48.006 48.006v96.01c0 26.49-21.497 47.987-48.006 47.987z" p-id="9886" fill="#d81e06"></path></svg>
                            <p>每日推荐</p>
                        </div>
                        <div onClick={this.sendToGedan.bind(this)}>
                            <svg t="1573829137466" className={disIndex.icon} viewBox="0 0 1110 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5312" width="40" height="40"><path d="M1105.222001 340.137465a123.72527 123.72527 0 0 0-32.27988-60.535478 226.558523 226.558523 0 0 0-48.377009-43.753366 342.492098 342.492098 0 0 0-44.43835-22.94697q-22.518855-9.504156-48.377009-20.720772a315.863338 315.863338 0 0 1-60.535478-36.989147 307.301035 307.301035 0 0 1-63.960399-57.281803Q783.621921 68.712477 767.439169 45.765507a178.267137 178.267137 0 0 0-31.680519-35.961671 48.291386 48.291386 0 0 0-39.64346-9.418532 68.49842 68.49842 0 0 0-46.150811 24.145693 81.170627 81.170627 0 0 0-17.124604 53.343144c-0.770607 110.710571-1.198722 615.972039-1.198723 615.972039a373.744502 373.744502 0 0 0-53.51439-14.641538 338.981554 338.981554 0 0 0-82.36935-6.164857 334.61478 334.61478 0 0 0-95.640918 18.494573 239.744469 239.744469 0 0 0-92.215998 59.508002 130.403866 130.403866 0 0 0-42.811512 91.44539 145.559142 145.559142 0 0 0 29.368697 89.73293 225.61667 225.61667 0 0 0 84.681172 67.813435 245.823704 245.823704 0 0 0 122.697794 23.631955 306.01669 306.01669 0 0 0 111.82367-24.145693 225.959162 225.959162 0 0 0 72.008964-50.003846 156.690135 156.690135 0 0 0 36.903523-62.247939 184.603241 184.603241 0 0 0 8.562303-59.936117v-63.960399l1.113099-493.70236v-48.205763a25.001923 25.001923 0 0 1 13.87093-24.745054 39.557837 39.557837 0 0 1 39.129722 17.124605 664.948409 664.948409 0 0 0 66.272221 57.795541 212.60197 212.60197 0 0 0 91.616637 40.927806 151.638377 151.638377 0 0 1 73.207686 29.71119 99.92207 99.92207 0 0 1 29.368697 64.55976 100.093316 100.093316 0 0 0 9.846648 36.989147 21.23451 21.23451 0 0 0 14.470291 11.216616 26.457515 26.457515 0 0 0 19.52205-15.155275 108.655618 108.655618 0 0 0 17.124605-42.040905 153.093968 153.093968 0 0 0-1.455592-57.709919zM528.208439 83.953376H0.684984v85.623024H528.294062v-85.623024z m-87.934847 171.246049H0.684984v85.623024h439.674231v-85.623024z m0 171.246049H0.684984v85.623024h439.674231v-85.623024z" fill="#d81e06" p-id="5313"></path></svg>
                            <p>歌单</p>
                        </div>
                        <div onClick={this.sendToPaihangbang.bind(this)}>
                        <svg t="1573829386035" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6240" width="40" height="40"><path d="M271.504 916.064c0 56.56-45.856 102.368-102.416 102.368l0 0c-56.544 0-102.368-45.808-102.368-102.368L66.72 399.568c0-56.544 45.84-102.384 102.368-102.384l0 0c56.56 0 102.416 45.84 102.416 102.384L271.504 916.064z" p-id="6241" fill="#d81e06"></path><path d="M977.088 916.56c0 56.56-45.856 102.4-102.4 102.4l0 0c-56.56 0-102.384-45.84-102.384-102.4L772.304 602.688c0-56.528 45.824-102.4 102.384-102.4l0 0c56.544 0 102.4 45.872 102.4 102.4L977.088 916.56z" p-id="6242" fill="#d81e06"></path><path d="M624.304 916.56c0 56.56-45.872 102.4-102.416 102.4l0 0c-56.544 0-102.384-45.84-102.384-102.4L419.504 107.392c0-56.544 45.84-102.384 102.384-102.384l0 0c56.544 0 102.416 45.84 102.416 102.384L624.304 916.56z" p-id="6243" fill="#d81e06"></path></svg>
                        <p>排行榜</p>
                        </div>
                        <div onClick={this.sendToDiantai.bind(this)}>
                            <svg t="1573829457447" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7062" width="40" height="40"><path d="M879.232 715.392c40.64-66.752 62.528-143.488 62.528-223.36 0-237.312-192.384-429.76-429.76-429.76-237.312 0-429.696 192.384-429.696 429.76 0 75.84 19.712 148.864 56.576 213.248 7.936 13.76 25.344 18.496 39.104 10.624 13.696-7.808 18.496-25.344 10.624-39.04-32-55.744-49.024-119.04-49.024-184.832 0-205.632 166.784-372.416 372.416-372.416 205.76 0 372.352 166.784 372.352 372.416 0 69.312-18.88 135.744-54.144 193.536-8.256 13.504-4.032 31.104 9.472 39.424C853.248 733.184 870.848 728.896 879.232 715.392zM732.224 613.44c24.512-40.064 37.632-86.144 37.632-134.08 0-142.464-115.392-257.856-257.856-257.856-142.4 0-257.792 115.392-257.792 257.856 0 45.504 11.84 89.344 33.92 128 7.872 13.76 25.344 18.432 39.104 10.56 13.76-7.808 18.496-25.344 10.688-39.04C320.64 548.8 311.424 514.816 311.424 479.36 311.424 368.576 401.28 278.848 512 278.848s200.512 89.728 200.512 200.512c0 37.312-10.112 73.152-29.12 104.256-8.256 13.504-4.032 31.104 9.472 39.36C706.496 631.232 724.096 626.944 732.224 613.44zM678.144 651.52c-1.984-9.792-6.976-19.392-15.488-28.544C654.144 613.44 646.4 606.528 639.36 602.24S625.28 594.368 618.112 591.424C611.008 588.416 603.264 585.152 595.008 581.568c-8.384-3.52-17.92-9.344-28.992-17.472C553.152 555.328 542.912 546.304 535.36 537.088 527.808 527.936 521.472 519.744 516.288 512.512 511.36 505.472 501.312 490.56 496.448 486.464l0 0.448C492.544 482.048 486.72 478.784 479.936 478.784c-12.032 0-21.696 9.6-21.696 21.504l0 308.352c-19.2-11.712-43.136-18.88-69.632-18.88-62.144 0-112.576 38.528-112.576 86.016s50.432 85.952 112.576 85.952c62.144 0 112.512-38.464 112.512-85.952 0 0 0.512-9.408 0.512-10.304l0-274.56c0.576-4.864 2.368-6.336 4.224-7.104C510.336 581.696 516.48 584.32 524.608 591.744c8.384 8.448 19.008 17.536 31.68 27.264 12.736 9.728 27.264 16.192 43.968 19.328 15.744 2.88 27.392 7.552 35.008 14.08 7.488 6.592 12.224 16.768 14.016 30.528 1.152 8.576 2.752 14.4 4.736 17.472 1.984 3.2 4.224 4.928 6.848 5.312 2.624 0.32 5.76-2.048 9.344-7.168s6.4-11.84 7.872-19.904C680 670.528 679.872 661.504 678.144 651.52z" p-id="7063" fill="#d81e06"></path></svg>
                            <p>电台</p>
                        </div>
                        <div onClick={this.sendToZhibo.bind(this)}>
                        <svg t="1573829536527" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9079" width="40" height="40"><path d="M435.2 290.3a51.18 51.18 0 0 0-51.2 0 51.192 51.192 0 0 0-25.6 44.35v354.7c0 18.3 9.75 35.2 25.6 44.35 7.92 4.58 16.75 6.85 25.6 6.85s17.67-2.27 25.6-6.85l307.2-177.35C758.25 547.2 768 530.3 768 512s-9.75-35.2-25.6-44.35L435.2 290.3z m25.6 310.37V423.33L614.4 512l-153.6 88.67z" p-id="9080" fill="#d81e06"></path><path d="M512 0C229.68 0 0 229.68 0 512s229.68 512 512 512c86.53 0 172.08-22 247.38-63.62 24.75-13.67 33.72-44.83 20.03-69.58-13.65-24.72-44.75-33.72-69.58-20.02C649.65 904.03 581.25 921.6 512 921.6c-225.85 0-409.6-183.75-409.6-409.6S286.15 102.4 512 102.4 921.6 286.15 921.6 512c0 27.95-2.82 55.92-8.42 83.17-5.7 27.7 12.15 54.78 39.85 60.45 27.77 5.78 54.77-12.17 60.45-39.85 6.98-34 10.53-68.93 10.53-103.78C1024 229.68 794.33 0 512 0z" p-id="9081" fill="#d81e06"></path><path d="M930.92 711.05c-24.05-15.05-55.65-7.58-70.5 16.45-9.92 15.97-20.95 31.3-32.77 45.55-18.05 21.78-15.03 54.08 6.75 72.1a51.042 51.042 0 0 0 32.65 11.77c14.73 0 29.33-6.33 39.45-18.52 14.78-17.83 28.53-36.95 40.88-56.85 14.92-24.02 7.57-55.58-16.46-70.5z" p-id="9082" fill="#d81e06"></path></svg>
                        <p>直播</p>
                        </div>
                    </div>
                   <div className={disIndex.main}>
                   <div className={disIndex.container}>
                        <div className={disIndex.con_header}>
                            <h2>推荐歌单</h2>
                            <Button  className={disIndex.button} onClick={this.sendToGedan.bind(this)}>歌单广场</Button>
                        </div>
                        <div className={disIndex.gd_main}>
                            {/* <div className="box">
                                {this.state.tjGedan.map((item,index)=><img key={index} src={item.picUrl} />)}
                            </div> */}
                            {this.state.tjGedan.map((item,index)=><div onClick={this.jumpToGd.bind(this,item.id)} key={index} className={disIndex.box}><img  src={item.picUrl} /><p>{item.name}</p></div>)}
                        </div>
                    </div>
                    <div className={disIndex.container}>
                        <div className={disIndex.con_header}>
                            <h2>新碟</h2>
                            <Button className={disIndex.button} onClick={this.sendToGedan.bind(this)}>更多新碟</Button>
                        </div> 
                        <div className={disIndex.con_main}>
                            <div className={disIndex.box}>
                                <img src={this.state.newCdUrl[0]} alt=""/>
                                <p>{this.state.newCdName[0]}</p>
                            </div>
                            <div className={disIndex.box}>
                                <img src={this.state.newCdUrl[1]} alt=""/>
                                <p>{this.state.newCdName[1]}</p>
                            </div>
                            <div className={disIndex.box}>
                                <img src={this.state.newCdUrl[2]} alt=""/>
                                <p>{this.state.newCdName[2]}</p>
                            </div>
                        </div>
                    </div>
                   </div>
                </div>
            )
        }else{
            return(
                <div className={disIndex.discover}>
                    <div className={disIndex.header}>
                        <div className={disIndex.shiqu}>
                        <svg t="1573803580998" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6229" width="32" height="46"><path d="M479.713154 703.614086c123.607202 0 223.857441-100.18577 223.857441-223.857441V223.921909c0-123.671671-100.250238-223.857441-223.857441-223.857441-123.608226 0-223.857441 100.18577-223.85744 223.857441v255.835759c0 123.670647 100.249215 223.856417 223.85744 223.856418zM319.815421 223.921909c0-88.319511 71.579245-159.897733 159.897733-159.897733s159.89671 71.578222 159.896711 159.897733v255.835759c0 88.321558-71.577199 159.89978-159.896711 159.89978s-159.897733-71.578222-159.897733-159.89978V223.921909z" p-id="6230"></path><path d="M799.509644 383.817596c-17.662265 0-31.980365 14.3181-31.980365 31.980365v63.958684c0 158.962431-128.856763 287.818171-287.816125 287.818171-158.960385 0-287.816125-128.85574-287.816124-287.818171v-63.918775l0.001023-0.039909c0-17.662265-14.3181-31.980365-31.980365-31.980365s-31.980365 14.3181-31.980366 31.980365v63.958684c0 183.473685 140.478452 334.153476 319.795467 350.314551v129.379672H351.795786c-17.662265 0-31.980365 14.3181-31.980365 31.980366s14.3181 31.980365 31.980365 31.980365h255.833713c17.662265 0 31.980365-14.3181 31.980366-31.980365s-14.3181-31.980365-31.980366-31.980366h-95.937003V830.071196c179.317015-16.161075 319.797513-166.840866 319.797514-350.314551v-63.958684c0-17.661242-14.3181-31.980365-31.980366-31.980365z" p-id="6231"></path></svg>
                        </div>
                        <div className={disIndex.search}>
                            <SearchBar onSubmit={this.searchSongs.bind(this)} onBlur={this.handleSearchF.bind(this)} placeholder="Search" maxLength={8} />
                            <WhiteSpace />
                        </div>
                        <div className={disIndex.bofang}>
                        <svg t="1573806248923" className={disIndex.icon} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7780" width="40" height="40"><path d="M896 960c-23.6 0-42.7-19.1-42.7-42.7v-512c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v512c0 23.6-19.1 42.7-42.7 42.7z m-256 0c-23.6 0-42.7-19.1-42.7-42.7V490.7c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v426.7c0 23.5-19.1 42.6-42.7 42.6z m-256 0c-23.6 0-42.7-19.1-42.7-42.7V106.7c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v810.7c0 23.5-19.1 42.6-42.7 42.6z m-256 0c-23.6 0-42.7-19.1-42.7-42.7V618.7c0-23.6 19.1-42.7 42.7-42.7s42.7 19.1 42.7 42.7v298.7c0 23.5-19.1 42.6-42.7 42.6z" fill="#333333" p-id="7781"></path></svg>
                        </div>
                    </div>
                    <div className={disIndex.hotSearch}>
                        <p>热搜榜</p>
                        {this.state.hotSearch.map((item,index)=>
                        <div key={index} className={disIndex.hotList}>
                            <p>{index+1}</p>
                            <div>{item.first}</div>
                        </div>
                        )}
                    </div>
                </div>
            )
        }
    }
}

export default Discover